/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Shared;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import javax.swing.JTextArea;

/**
 *
 * @author danielsl & thorerikmidtb
 *
 * This interface contains methods that are put forward from the callback server to the client, so that the client can use these methods.
 * The client will be a server so to speak, and the server the client(!)
 * Please take a look at http://java.sun.com/developer/onlineTraining/rmi/RMI.html#RMIClientSideCallbacks to understand more of this.
 */
public interface Callback extends Remote{
    /**
     * This is used by the server, sending out a message containing the user name connected.
     * @param userName
     * @throws RemoteException
     */
    void connectMessage(String userName) throws RemoteException;

    /**
     * This is used by the server, sending out the message a client has typed.
     * @param message
     * @param userName
     * @throws RemoteException
     */
    void broadcastMessage(String message, String userName) throws RemoteException;


    /**
     * This is used by the server, sending out a message that a client has left the server.
     * @param userName
     * @throws RemoteException
     */
    void quitMessage(String userName) throws RemoteException;


    /**
     * This is used by the server, getting the user name of the client.
     * @return
     * @throws RemoteException
     */
    String getUserName() throws RemoteException;

    /**
     * This is used by the server, setting the user name of the client.
     * @param userName
     * @throws RemoteException
     */
    void setUserName(String userName) throws RemoteException;

    /**
     * This is used by the server, showing the user who is online.
     * @param userList
     * @throws RemoteException
     */
    void getClientList(ArrayList<String> userList) throws RemoteException;

    /**
     * This is used by the client, which sets the textarea for the private conversation.
     * @param pmArea
     * @throws RemoteException
     */
    void setPmTextArea(javax.swing.JTextArea pmArea) throws RemoteException;

    /**
     * This is used by the client, which sets the textarea for the main chat.
     * @param area
     * @throws RemoteException
     */
    void setTextArea(javax.swing.JTextArea area) throws RemoteException;

    void cbUpdateProjectList() throws RemoteException;
    

    void cbUpdateDecisionList() throws RemoteException;
    void cbUpdateActionlist() throws RemoteException;
    void cbUpdateUserList() throws RemoteException;
    void cbUpdateVoiceList() throws RemoteException;
    void cbUpdateActivityList() throws RemoteException;
    void cbStartCountDown(int min) throws RemoteException;
    void cbStopCountDown() throws RemoteException;
    void cbResumeCountDown() throws RemoteException;
    void cbUpdateSessions() throws RemoteException;
    void cbUpdateResources() throws RemoteException;

    Module.Project getSelectedProject() throws RemoteException;
}

